package com.yz.xyt.controller;

import com.yz.xyt.constant.HttpStatus;
import com.yz.xyt.domain.ResponseResult;
import com.yz.xyt.service.IInsideSyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 内部同步接口(紧急情况使用)
 * 使用方法
 * 1、创建staff_tmp、student_tmp两张表
 * 2、将拿到的教职工和学生数据导入上面的表中
 * 3、分别调用内部同步接口的同步staff和同步student方法
 */
@RestController
@RequestMapping("/inside")
public class InsideSyncController {
    @Autowired
    IInsideSyncService insideSyncService;

    @RequestMapping("/syncStaff")
    public ResponseResult insideSyncStaff(){
        insideSyncService.syncStaff();
        return new ResponseResult(HttpStatus.SUCCESS,"同步成功");
    }

    @RequestMapping("/syncStudent")
    public ResponseResult insideSyncStudent(){
        insideSyncService.syncStudent();
        return new ResponseResult(HttpStatus.SUCCESS,"同步成功");
    }
}
